Skip to content

Conversation

@ethanpailes
Copy link
Contributor

This patch fixes an issue where we would peg the CPU if the stdin to shpool attach was null.

We handle this by immediately exiting the attach proc if stdin is null.

Fixes #243

Replaces #246

@maxhbooth
Copy link

looks like there are some cranky errors:

error: length comparison to zero
    --> shpool/tests/attach.rs:1592:12
     |
1592 |         if list_blob["sessions"].as_array().unwrap().len() == 0 {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `list_blob["sessions"].as_array().unwrap().is_empty()`

This patch fixes an issue where we would peg the CPU
if the stdin to `shpool attach` was null.

We handle this by immediately exiting the attach proc
if stdin is null.

Fixes #243

Replaces #246
@ethanpailes ethanpailes force-pushed the fix-CPU-spinning-on-null-stdin branch from 5b9664b to d8ba4c6 Compare February 5, 2026 23:00
@ethanpailes
Copy link
Contributor Author

Yeah, true. Should be fixed now.

@ethanpailes ethanpailes merged commit 6f96063 into master Feb 5, 2026
7 checks passed
@ethanpailes ethanpailes deleted the fix-CPU-spinning-on-null-stdin branch February 5, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running shpool in background consumes CPU

2 participants